/*
 * FileManager.h
 *
 *  Created on: Oct 21, 2012
 *      Author: bruno
 */

#ifndef FILEMANAGER_H_
#define FILEMANAGER_H_

#define DEFAULT_TEMP_FOLDER_NAME particiones
#define FILESYSTEM_SEPARATOR "/"

#include <memory>
#include <iostream>
#include <sstream>
#include <sys/stat.h>
#include "DictionaryFileImplementation.h"

typedef std::shared_ptr<IDictionaryStorage> IDS_ptr;

class FileManager {
private:
	std::string workingFile;
	std::string workingDir;
	std::string readingDir;
	std::string tempFolderName;
	std::string outputFileName;
	int tempLevel;
	int currentNewTempFileNumber;
	int currentTempFileNumber;
	int maxTempFileNumber;
	int bufferSizeFactor;
	bool outputInteger;
	bool printTmpLevel;

	std::string intToString(int);

public:
	FileManager(std::string, unsigned int, std::string, bool);
	virtual ~FileManager();
	void setWorkingDir(std::string);
	std::string getWorkingDir();
	void setTempFolderName(std::string);
	std::string getTempFolderName();
	IDS_ptr getInput();
	IDS_ptr getOutput();
	IDS_ptr getNewTempFile();
	IDS_ptr getNextTempFile();
	void increaseLevel();
	void setPrintTmpLevel(bool);

};

#endif /* FILEMANAGER_H_ */
